{{! -------------------------------------------------------------------------- }}
{{! Copyright 2002-2016, OpenNebula Project, OpenNebula Systems                }}
{{!                                                                            }}
{{! Licensed under the Apache License, Version 2.0 (the "License"); you may    }}
{{! not use this file except in compliance with the License. You may obtain    }}
{{! a copy of the License at                                                   }}
{{!                                                                            }}
{{! http://www.apache.org/licenses/LICENSE-2.0                                 }}
{{!                                                                            }}
{{! Unless required by applicable law or agreed to in writing, software        }}
{{! distributed under the License is distributed on an "AS IS" BASIS,          }}
{{! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   }}
{{! See the License for the specific language governing permissions and        }}
{{! limitations under the License.                                             }}
{{! -------------------------------------------------------------------------- }}

<form data-abide novalidate id="{{formPanelId}}Wizard" class="custom creation">
  <div class="row">
    <div class="medium-6 columns">
      <label for="name" >{{tr "Name"}}</label>
      <input required type="text" name="name" id="name"/>
    </div>
  </div>
  <div class="row">
    <div class="medium-6 columns">
      <label for="presets">{{tr "Storage backend"}}</label>
      <select id="presets" name="presets">
        <option ds="fs" tm="shared" value="fs_shared">{{tr "Filesystem - shared mode"}}</option>
        <option ds="fs" tm="ssh"    value="fs_ssh">{{tr "Filesystem - ssh mode"}}</option>
        <option ds="fs" tm="qcow2"  value="fs_qcow2">{{tr "Filesystem - qcow2 mode"}}</option>
        <option ds="ceph" tm="ceph" value="ceph">{{tr "Ceph"}}</option>
        <option ds="vcenter" tm="vcenter" value="vcenter">{{tr "vCenter"}}</option>
        <option ds="fs" tm="lvm" value="lvm">{{tr "LVM"}}</option>
        <option ds="dev" tm="dev" value="raw">{{tr "Raw Device Mapping"}}</option>
        <option ds="iscsi" tm="iscsi" value="iscsi_libvirt">{{tr "iSCSI - Libvirt initiator "}}</option>
        <option value="custom">{{tr "Custom"}}</option>
      </select>
    </div>
    <div class="medium-6 columns">
      <label for="cluster">{{tr "Cluster"}}</label>
      <div id="cluster_id" name="cluster_id"></div>
    </div>
  </div>
  <div class="row drivers">
    <div class="large-12 columns">
      <fieldset>
        <legend>{{tr "Drivers"}}</legend>
        <div class="medium-6 columns">
          <label for="ds_mad">{{tr "Datastore"}}</label>
          <select id="ds_mad" name="ds_mad">
            <option value="fs">{{tr "Filesystem"}}</option>
            <option value="ceph">{{tr "Ceph"}}</option>
            <option value="dev">{{tr "Devices"}}</option>
            <option value="iscsi_libvirt">{{tr "iSCSI/Libvirt"}}</option>
            <option value="vcenter">{{tr "vCenter"}}</option>
            <option value="custom">{{tr "Custom"}}</option>
          </select>
          <div>
            <label>{{tr "Custom DS_MAD"}}</label>
            <input type="text" name="ds_tab_custom_ds_mad" />
          </div>
        </div>
        <div class="medium-6 columns">
          <label for="tm_mad">{{tr "Transfer"}}</label>
          <select id="tm_mad" name="tm_mad">
            <option value="shared">{{tr "Shared"}}</option>
            <option value="ssh">{{tr "SSH"}}</option>
            <option value="qcow2">{{tr "qcow2"}}</option>
            <option value="fs_lvm">{{tr "FS LVM"}}</option>
            <option value="ceph">{{tr "Ceph"}}</option>
            <option value="dev">{{tr "Devices"}}</option>
            <option value="iscsi_libvirt">{{tr "iSCSI/Libvirt"}}</option>
            <option value="vcenter">{{tr "vCenter"}}</option>
            <option value="custom">{{tr "Custom"}}</option>
          </select>
          <div>
            <label>{{tr "Custom TM_MAD"}}</label>
            <input type="text" name="ds_tab_custom_tm_mad" />
          </div>
        </div>
      </fieldset>
    </div>
  </div>
  <div class="row">
    <div class="large-12 columns">
      <fieldset>
        <legend>{{tr "Datastore Type"}}</legend>
        <div class="large-12 columns text-center">
          <input id="image_ds_type" type="radio" name="ds_type" value="IMAGE_DS" checked/>
          <label for="image_ds_type">{{tr "Images"}}</label>
          <input id="system_ds_type" type="radio" name="ds_type" value="SYSTEM_DS" />
          <label for="system_ds_type">{{tr "System"}}</label>
          <input id="file_ds_type" type="radio" name="ds_type" value="FILE_DS" />
          <label for="file_ds_type">{{tr "Files"}}</label>
        </div>
      </fieldset>
    </div>
  </div>
  <div class="row disk_type_wrapper">
    <div class="medium-6 columns">
      <label for="disk_type">{{tr "Disk type"}}</label>
      <select id="disk_type" name="disk_type">
        <option value="file">{{tr "File"}}</option>
        <option value="block">{{tr "Block"}}</option>
        <option value="RBD">{{tr "RBD"}}</option>
        <option value="gluster">{{tr "Gluster"}}</option>
        <option value="iscsi">{{tr "iSCSI/Libvirt"}}</option>
      </select>
    </div>
  </div>
  <div class="row">
    <div class="large-12 columns">
      <label>
        {{tr "Restricted directories for registering Images"}}
        <input type="text" name="restricted_dirs" id="restricted_dirs" placeholder="/path/to/dir /path/to/other/dir"/>
      </label>
    </div>
    <div class="large-12 columns">
      <label>
        {{tr "Safe directories for registering Images"}}
        <input type="text" name="safe_dirs" id="safe_dirs" placeholder="/path/to/dir /path/to/other/dir"/>
      </label>
    </div>
    <div class="medium-6 columns">
      <label>
        {{tr "Storage usage limit (MB)"}}
        <input type="number" min="0" name="limit_mb" id="limit_mb" />
      </label>
    </div>
    <div class="medium-6 columns">
      <label for="limit_transfer_bw">
        {{tr "Transfer bandwidth limit (B/s)"}}
        <span class="tip">
          {{tr "Specify the maximum transfer rate in bytes/second when downloading images from a http/https URL. Suffixes K, M or G can be used."}}
        </span>
        <input type="text" name="limit_transfer_bw" id="limit_transfer_bw" />
      </label>
    </div>
    <div class="large-12 columns">
      <input id="no_decompress" type="checkbox" name="no_decompress" value="YES" />
      <label for="no_decompress">{{tr "Do not try to untar or decompress"}}</label>
    </div>
    <div class="large-12 columns">
      <input id="datastore_capacity_check" type="checkbox" name="datastore_capacity_check" value="YES" />
      <label for="datastore_capacity_check">
        {{tr "Check available capacity of the Datastore before creating a new Image"}}
      </label>
    </div>
    <div class="large-12 columns">
      <label for="bridge_list">
        {{tr "Host bridge list"}}
        <span class="tip">
          {{tr "Space separated list of servers to add new Images to the Datastore storage"}}
        </span>
      </label>
      <input type="text" name="bridge_list" id="bridge_list" />
    </div>
    <div class="medium-6 columns">
      <label for="vg_name">{{tr "Volume Group Name"}}</label>
      <input type="text" name="vg_name" id="vg_name" />
    </div>
    <div class="medium-6 columns">
      <label for="gluster_host">
        {{tr "Gluster Host"}}
        <span class="tip">
          {{tr "Host and port of one (and only one) Gluster server (host:port)"}}
        </span>
      </label>
      <input type="text" name="gluster_host" id="gluster_host" />
    </div>
    <div class="medium-6 columns">
      <label for="gluster_volume">
        {{tr "Gluster Volume"}}
        <span class="tip">{{tr "Gluster volume to use for the datastore"}}</span>
      </label>
      <input type="text" name="gluster_volume" id="gluster_volume" />
    </div>
    <div class="medium-6 columns">
      <label for="pool_name">
        {{tr "Ceph pool to store Images"}}
      </label>
      <input type="text" name="pool_name" id="pool_name" />
    </div>
    <div class="medium-6 columns">
      <label for="ceph_host">
        {{tr "Ceph host"}}
        <span class="tip">
          {{tr "Space-separated list of Ceph monitors"}}
        </span>
      </label>
      <input type="text" name="ceph_host" id="ceph_host" placeholder="host1 host2:port2"/>
    </div>
    <div class="medium-6 columns">
      <label for="ceph_user">
        {{tr "Ceph user"}}
        <span class="tip">
          {{tr "The username to interact with the Ceph cluster"}}
        </span>
      </label>
      <input type="text" name="ceph_user" id="ceph_user" />
    </div>
    <div class="medium-6 columns">
      <label for="ceph_secret">
        {{tr "Ceph secret"}}
        <span class="tip">
          {{tr "A generated UUID for a LibVirt secret"}}
        </span>
      </label>
      <input type="text" name="ceph_secret" id="ceph_secret" />
    </div>
    <div class="medium-6 columns">
      <label class="fs" for="staging_dir">
        {{tr "Staging directory for Image registration"}}
      </label>
      <input type="text" name="staging_dir" id="staging_dir" />
    </div>
    <div class="medium-6 columns">
      <label for="rbd_format">
        {{tr "RBD format"}}
      </label>
      <input type="text" name="rbd_format" id="rbd_format" />
    </div>
    <div class="medium-6 columns">
      <label class="fs" for="ceph_conf">
        {{tr "Ceph configuration file path"}}
        <span class="tip">
          {{tr "Needed if using a non-default path for the ceph configuration file."}}
        </span>
      </label>
      <input type="text" name="ceph_conf" id="ceph_conf" />
    </div>
    <div class="medium-6 columns">
      <label for="iscsi_host">
        {{tr "iSCSI host"}}
        <span class="tip">
          {{tr "Example: 'host' or 'host:port'"}}
        </span>
      </label>
      <input type="text" name="iscsi_host" id="iscsi_host" />
    </div>
    <div class="medium-6 columns">
      <label for="iscsi_user">
        {{tr "iSCSI user for CHAP authentication"}}
      </label>
      <input type="text" name="iscsi_user" id="iscsi_user" />
    </div>
    <div class="medium-6 columns">
      <label for="iscsi_usage">
        {{tr "iSCSI usage for CHAP authentication"}}
        <span class="tip">
          {{tr "'Usage' of the registered secret with the authentication string."}}
        </span>
      </label>
      <input type="text" name="iscsi_usage" id="iscsi_usage" />
    </div>
    <div class="medium-6 columns">
      <label for="vceter_cluster">
        {{tr "vCenter cluster"}}
        <span class="tip">
          {{tr "The vCenter Cluster that has access to this datastore."}}
        </span>
        <div id="vcenter_cluster_wrapper"></div>
      </label>
    </div>
  </div>
</form>
